home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 3232 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.6 KB  |  73 lines

  1. Path: f411.n201!not-for-mail
  2. Newsgroups: comp.sys.cbm
  3. X-Comment-To: William Nolan
  4. From: Pontus Berg <Pontus.Berg@p71.anet.canit.se>
  5. Date: Fri, 01 Mar 96 21:18:20 +0100
  6. Subject: Programming (assembler) Question
  7. Message-ID: <825736419@p71.f411.n201.z2.ftn>
  8. References: <178469473@andrew.cmu.edu>
  9. Organization: BoArDgasm, Farsta, Sweden
  10. X-FTN-AREA: CANIT_COMP_SYS_CBM
  11. X-FTN-MSGID: 2:201/411.71 3137bce3
  12. X-FTN-REPLY: andrew.cmu.edu 0aa33a61
  13. X-FTN-CHRS: IBMPC 2
  14. X-FTN-Tearline: Spot 1.3a #676
  15. X-FTN-Origin: BoArDgasm, Farsta, Sweden (2:201/411.71)
  16. X-FTN-SEEN-BY: 201/411 
  17. X-FTN-PATH: 201/411 
  18. X-FTN-PATH: 201/411
  19.  
  20. In a message of 28 Feb 96 William Nolan wrote to All:
  21.  
  22.  WN> Okay, here's my problem.  In a lot of my Turbo Assembler programs, I use
  23.  WN> the * directive several times to place data at the appropriate locations
  24.  WN> in memory (ie sprite data, character set data, etc).  When I compile and
  25.  WN> run under Turbo Assembler, these programs work fine, since I assume that
  26.  WN> as it assembles, TA puts the data in the right places in memory.  But
  27.  WN> when I compile to object code and save that to disk, the often programs
  28.  WN> stop working.  So I was wondering what to do about this?  Any ideas?
  29.  
  30. It depends on how you assembler it! As I see it, there's two options and I'll
  31. try to cover both - do you assembler with "<-" + "3" and save the memory or do
  32. you assemble directly to disk with "<-" + "5"?
  33.  
  34. If you do the first, I have no help for you as that should be 100% the same as
  35. assembling and running directly from the assembler.
  36.  
  37. If you do the latter, then you have encountered a "feature" of TurboAssembler.
  38. In "assemble to disk" only the very first "*=" does anything. The logical thing
  39. would be to have the "*=" start a new file or something similar, but it doesn't.
  40.  
  41. So if you have code from $1000 to $1800 and then have a "*=$2000", the first
  42. byte after the PC-change command, when assembled to disk does NOT land on $2000
  43. but on $1800!
  44.  
  45. f.ex.
  46.  
  47.         *=$1000
  48.  
  49.         sei
  50.         lda #$00
  51.  
  52.         ... ;Lots of more code
  53.  
  54. label
  55.  
  56.         *=$2000
  57.  
  58.         .byte $00,$00,$00,$00,$00
  59.  
  60. In this example the bytes land at the label "label", as if the *= just hadn't
  61. been there!
  62.  
  63. (Hard to explain in an understandable way but I hop you got the point!
  64.  
  65. )==========================================================(
  66. )  o/    Bacchus@FairLight.COM  Fido: 2:201/411.71         (
  67. ) (#  I'm a "geek tool" so ask about emulators elsewhere!  (
  68. )=/7=======================================================(
  69.  
  70. ... The C64 is my only religion!
  71.     It's for real and can be proven and it's for sure divine!
  72.     (Pontus Berg)
  73.